#define _CRT_SECURE_NO_WARNINGS	

int prime(int x)
{
    if (x < 2)
        return 0;
    for (int i = 2; i <= sqrt(x); i++)
    {
        if (x % i == 0)
            return 0;
    }
    return 1;
}

int sum_prime(int a, int b)
{
    if (a > b)
    {
        int c = a;
        a = b;
        b = c;
    }
    int count = 0;
    for (int i = a; i <= b; i++)
    {
        if (prime(i))
            count += i;
    }
    return count;
}